<?php
/**
 * Controller is the customized base controller class.
 * All controller classes for this application should extend from this base class.
 */
class Controller extends CController
{
	/**
	 * @var string the default layout for the controller view. Defaults to '//layouts/column1',
	 * meaning using a single column layout. See 'protected/views/layouts/column1.php'.
	 */
	public $layout='//layouts/column1';
	/**
	 * @var array context menu items. This property will be assigned to {@link CMenu::items}.
	 */
	public $menu=array();
	/**
	 * @var array the breadcrumbs of the current page. The value of this property will
	 * be assigned to {@link CBreadcrumbs::links}. Please refer to {@link CBreadcrumbs::links}
	 * for more details on how to specify this property.
	 */
	public $breadcrumbs=array();
	
	
	/**
	 * @param $name 隐藏字段名
	 * @param $value 隐藏字段值
	 * @param $toolbar 工具栏样式,可选值 Basic Default
	 * @param $skin 面板,可选值 default office2003 silver
	 * @param $Lang 语言,可选值 zh-cn zh e
	 *
	 */
	public function htmlEdit($name,$value,$height=420,$width=720,$toolbar='Default',$skin='office2003',$Lang='en'){
		require_once  (__SITE_ROOT__.DS."www/js/FCKeditor/fckeditor.php");
		
		$sBasePath = "/js/FCKeditor/";
			
		$oFCKeditor = new FCKeditor($name) ;
		
		$oFCKeditor->BasePath = $sBasePath ;
		if($Lang) 		$oFCKeditor->Config['AutoDetectLanguage'] = false ;
		if($Lang) 		$oFCKeditor->Config['DefaultLanguage'] = $Lang ;
		if($skin) 		$oFCKeditor->Config['SkinPath'] = $sBasePath . 'editor/skins/'.$skin.'/' ;
		if($toolbar)	$oFCKeditor->ToolbarSet = $toolbar ;
		if($width) 		$oFCKeditor->Width = $width ;
		if($height) 	$oFCKeditor->Height = $height ;
		$oFCKeditor->Value = $value ;
		return $oFCKeditor->CreateHtml() ;
	}
}